package security.core.filter.handler.impl;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;

import security.core.filter.handler.LogoutSuccessHandler;
import security.debug.RBACLogger;

public class RBACLogoutSuccessHandler implements LogoutSuccessHandler {

	@Override
	public void onLogoutSuccess(ServletRequest request,
			ServletResponse response, String redirectURL) throws IOException, ServletException {
		// TODO Auto-generated method stub
		if (RBACLogger.debug()) {
			RBACLogger.log("RBACLogoutSuccessHandler#onLogoutSuccess is called!");
			RBACLogger.log("logout success!");
			RBACLogger.log("redirecting to " + redirectURL);
		}
		((HttpServletResponse)response).sendRedirect(redirectURL);
	}

}
